//
//  AudioChatViewController.m
//  WChat
//
//  Created by lee on 2018/8/8.
//  Copyright © 2018年 mjsfax. All rights reserved.
//

#import "AudioChatViewController.h"

@interface AudioChatViewController ()<EMCallManagerDelegate>
@property (weak, nonatomic) IBOutlet UILabel *lbName;
@property (weak, nonatomic) IBOutlet UILabel *lbMessage;

@end

@implementation AudioChatViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [[EaseMob sharedInstance].callManager addDelegate:self delegateQueue:nil];
}

- (IBAction)cancle:(id)sender {
    EMError *error = [[EaseMob sharedInstance].callManager asyncEndCall:self.session.sessionId reason:eCallReasonReject];
    if (error) {
        [MSToast show:error.description];
    }
    [self dismissViewControllerAnimated:YES completion:nil];
}

- (IBAction)agree:(UIButton *)sender {
    EMError *error = [[EaseMob sharedInstance].callManager asyncAnswerCall:self.session.sessionId];
    if (error) {
        [MSToast show:error.description];
    }
}



@end
